package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oceanread.cn.entity.Treelist1;
import com.oceanread.cn.entity.Turbine;
import com.oceanread.cn.mapper.Treelist1Mapper;
import com.oceanread.cn.mapper.TurbineMapper;
import com.oceanread.cn.service.ITreelist1Service;
import com.oceanread.cn.service.ITurbineService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ITurbineServiceImpl extends ServiceImpl<TurbineMapper, Turbine> implements ITurbineService {
    public List<Turbine> getall() {
        return baseMapper.getall();
    }

    @Override
    public List<Turbine> query(int page, int size, String key, String value) {
        return baseMapper.query((page - 1) * size, size, key, value);
    }
    @Override
    public List<Turbine> equal(String key, String value) {
        return baseMapper.equal(key, value);
    }
    @Override
    public List<Turbine> queryEqual(int page, int size, String key, String value) {
        return baseMapper.queryEqual((page - 1) * size, size, key, value);
    }

    @Override
    public List<Turbine> getTablelist(int page, int size) {
        return baseMapper.getTablelist((page - 1) * size, size);
    }

    public Integer getnum() {
        return baseMapper.getnum();
    }

    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }
    public Integer getnumqueryEqual(String key, String value) {
        return baseMapper.getnumqueryEqual(key, value);
    }

    @Override
    public int insert(String PrjCode, String Name, String ID, String Lat, String Lon,
                      String Status, String Speed, String Power) {
        return baseMapper.insert(PrjCode, Name, ID, Lat, Lon, Status, Speed, Power);
    }
    @Override
    public Integer update(Turbine turbine) {
        return baseMapper.update(turbine.getSysid(),turbine.getPrjCode(),turbine.getName(),turbine.getID(),turbine.getLat(),
                turbine.getLon(),turbine.getStatus(),turbine.getSpeed(),turbine.getPower());
    }
    public Integer delete(int sysid) {
        return baseMapper.delete(sysid);
    }

}
